//
//  ViewController.m
//  UIHomeWork04
//
//  Created by tusm on 16/7/19.
//  Copyright © 2016年 tusm. All rights reserved.
//

#import "ViewController.h"
#import "Masonry.h"
@interface ViewController ()
@property (nullable,nonatomic,strong)UIImageView *imgBackView;
@property (nullable,nonatomic,strong)UIImageView *imgPicView;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    [self createSubView];
}

- (void)createSubView{
    //背景图片
    _imgBackView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"player_albumblur_default.jpg"]];
    [self.view addSubview:_imgBackView];

    [_imgBackView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.right.mas_equalTo(0);
    }];
    _imgBackView.userInteractionEnabled = YES;
    
    
    //中间图片
    _imgPicView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"7.jpg"]];
    [_imgBackView addSubview:_imgPicView];

    [_imgPicView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(150);
        make.left.mas_equalTo(60);
        make.width.mas_equalTo(300);
        make.height.mas_equalTo(300);
    }];

    _imgPicView.clipsToBounds = YES;
    _imgPicView.layer.cornerRadius = 150;
    _imgPicView.layer.shadowColor = [UIColor lightGrayColor].CGColor;
    _imgPicView.layer.shadowOffset = CGSizeMake(30,30);

    //歌曲名Label
    UILabel *labelOfSongName = [[UILabel alloc]init];
    [_imgBackView addSubview:labelOfSongName];
    [labelOfSongName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(160);
        make.top.mas_equalTo(10);
        make.width.mas_equalTo(100);
        make.height.mas_equalTo(40);
    }];

    
    labelOfSongName.text = @"天空之城";
    labelOfSongName.textColor = [UIColor whiteColor];
    labelOfSongName.font = [UIFont systemFontOfSize:20];
    
    //歌手名
    UILabel *labelOfSinger = [[UILabel alloc] initWithFrame:CGRectMake(160, 40, 100, 40)];
    [_imgBackView addSubview:labelOfSinger];
    [labelOfSinger mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(160);
        make.top.mas_equalTo(40);
        make.width.mas_equalTo(100);
        make.height.mas_equalTo(40);
    }];

    labelOfSinger.text = @"-- 李志 --";
    labelOfSinger.textColor = [UIColor whiteColor];
    labelOfSinger.font = [UIFont systemFontOfSize:20];
    
    
    //四个小图片
    UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
    [button1 setImage:[UIImage imageNamed:@"player_btn_bz_sel_normal"] forState:UIControlStateNormal];
//    [button1 setImage:[UIImage imageNamed:@"player_btn_bz_sel_highlight"] forState:UIControlStateHighlighted];
    [_imgBackView addSubview:button1];
    [button1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(60);
        make.top.mas_equalTo(90);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(50);
    }];
    button1.showsTouchWhenHighlighted = NO;
    
    
    UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom];
    [button2 setImage:[UIImage imageNamed:@"player_btn_copyright_normal"] forState:UIControlStateNormal];
    [_imgBackView addSubview:button2];
    [button2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(120);
        make.top.mas_equalTo(90);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(50);
    }];
    
    
    UIButton *button3 = [UIButton buttonWithType:UIButtonTypeCustom];
    [button3 setImage:[UIImage imageNamed:@"player_btn_mv_normal"] forState:UIControlStateNormal];
    [_imgBackView addSubview:button3];
    [button3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(190);
        make.top.mas_equalTo(90);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(50);
    }];
    
    
    
    UIButton *button4 = [UIButton buttonWithType:UIButtonTypeCustom];
    [button4 setImage:[UIImage imageNamed:@"player_btn_dts_on"] forState:UIControlStateNormal];
    [_imgBackView addSubview:button4];
    [button4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(260);
        make.top.mas_equalTo(90);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(50);
    }];
    
    //歌词label
    UILabel *labeOfLyrics = [[UILabel alloc] init];
    [_imgBackView addSubview:labeOfLyrics];
    [labeOfLyrics mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(130);
        make.top.mas_equalTo(470);
        make.width.mas_equalTo(200);
        make.height.mas_equalTo(40);
    }];
    labeOfLyrics.text = @"hdshfkdsfsdknfdsjk";
    labeOfLyrics.textColor = [UIColor whiteColor];
    
    //UIPage
    UIPageControl *pageControl = [[UIPageControl alloc] init];
    pageControl.numberOfPages = 3;
    [_imgBackView addSubview:pageControl];
    [pageControl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(200);
        make.top.mas_equalTo(520);
        make.width.mas_equalTo(0);
        make.height.mas_equalTo(0);
    }];
    
    
    
    UISlider *slider = [[UISlider alloc] init];
    [self.view addSubview:slider];
    [slider mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30);
        make.top.mas_equalTo(550);
        make.width.mas_equalTo(self.view.frame.size.width - 60);
        make.height.mas_equalTo(30);
    }];
    slider.minimumTrackTintColor = [UIColor colorWithRed:0.23 green:0.75 blue:0.49 alpha:1.00];
    slider.thumbTintColor = [UIColor colorWithRed:0.23 green:0.75 blue:0.49 alpha:1.00];
    
    
    //上一首
    UIButton *buttonUp = [UIButton buttonWithType:UIButtonTypeCustom];
    [buttonUp setImage:[UIImage imageNamed:@"player_btn_pre_normal"] forState:UIControlStateNormal];
    [_imgBackView addSubview:buttonUp];
    [buttonUp mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(100);
        make.top.mas_equalTo(580);
        make.width.mas_equalTo(70);
        make.height.mas_equalTo(70);
    }];
    
    
    UIButton *buttonCenter = [UIButton buttonWithType:UIButtonTypeCustom];
    [buttonCenter setImage:[UIImage imageNamed:@"player_btn_play_normal"] forState:UIControlStateNormal];
    [_imgBackView addSubview:buttonCenter];
    [buttonCenter mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(180);
        make.top.mas_equalTo(580);
        make.width.mas_equalTo(70);
        make.height.mas_equalTo(70);
    }];
    
    UIButton *buttonNext = [UIButton buttonWithType:UIButtonTypeCustom];
    [buttonNext setImage:[UIImage imageNamed:@"player_btn_next_normal"] forState:UIControlStateNormal];
    [_imgBackView addSubview:buttonNext];
    [buttonNext mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(260);
        make.top.mas_equalTo(580);
        make.width.mas_equalTo(70);
        make.height.mas_equalTo(70);
    }];
    
    
    //最下一行
    UIButton *buttonFavorite = [UIButton buttonWithType:UIButtonTypeCustom];
    [buttonFavorite setImage:[UIImage imageNamed:@"player_btn_favorited_normal"] forState:UIControlStateNormal];
    [_imgBackView addSubview:buttonFavorite];
    [buttonFavorite mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30);
        make.top.mas_equalTo(650);
        make.width.mas_equalTo(90);
        make.height.mas_equalTo(90);
    }];

    UIButton *buttonXunHuan = [UIButton buttonWithType:UIButtonTypeCustom];
    [buttonXunHuan setImage:[UIImage imageNamed:@"3dtouch_menu_recognize"] forState:UIControlStateNormal];
    [_imgBackView addSubview:buttonXunHuan];
    [buttonXunHuan mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(90);
        make.top.mas_equalTo(650);
        make.width.mas_equalTo(90);
        make.height.mas_equalTo(90);
    }];

    
    
    UIButton *buttonDownLoad = [UIButton buttonWithType:UIButtonTypeCustom];
    [buttonDownLoad setImage:[UIImage imageNamed:@"Unknown"] forState:UIControlStateNormal];
    [_imgBackView addSubview:buttonDownLoad];
    [buttonDownLoad mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(150);
        make.top.mas_equalTo(650);
        make.width.mas_equalTo(90);
        make.height.mas_equalTo(90);
    }];

    
    UIButton *buttonShare = [UIButton buttonWithType:UIButtonTypeCustom];
    [buttonShare setImage:[UIImage imageNamed:@"concise_icon_download_normal"] forState:UIControlStateNormal];
    [_imgBackView addSubview:buttonShare];
    [buttonShare mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(210);
        make.top.mas_equalTo(650);
        make.width.mas_equalTo(90);
        make.height.mas_equalTo(90);
    }];

    
    UIButton *buttonList = [UIButton buttonWithType:UIButtonTypeCustom];
    [buttonList setImage:[UIImage imageNamed:@"3dtouch_menu_recognize"] forState:UIControlStateNormal];
    buttonList.frame = CGRectMake(270, 650, 90, 90);
    [_imgBackView addSubview:buttonList];
    [buttonList mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(270);
        make.top.mas_equalTo(650);
        make.width.mas_equalTo(90);
        make.height.mas_equalTo(90);
    }];


}



















- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
